package com.easygoods.request;

import com.bestvike.stone.spring.exception.AssertUtils;
import com.bestvike.stone.spring.rest.IRequest;
import com.easygoods.service.ConfigService;
import lombok.Data;

/**
 * Created by 许崇雷 on 2019-04-01.
 */
@Data
public class ChangePayPwdBySmsRequest implements IRequest {
    private String verifyCode;//验证码
    private String newPayPwd;//新支付密码

    @Override
    public void assertValid() {
        AssertUtils.hasText(this.verifyCode, "verifyCode");
        AssertUtils.hasText(this.newPayPwd, "newPayPwd");
        AssertUtils.isTrue(this.newPayPwd.length() == ConfigService.getPayPwdLength(), "支付密码必须为" + ConfigService.getPayPwdLength() + "位");
    }
}
